package ar.com.angel.beans.sync{
	import mx.controls.Alert;
	import mx.rpc.events.ResultEvent;

    [RemoteClass(alias="com.angel.arquitectura.model.command.SpringMultipleServiceCommand")]
    public class Command {

        public var serviceName : String;
        public var methodName : String;
        public var arguments : Array;

        private var _callbackFunction : Function;

        public function Command(serviceName : String, methodName : String) {
            this.serviceName = serviceName;
            this.methodName = methodName;
            this.arguments = [];
        }

        public function callback(result : Object) : void {
            if(_callbackFunction != null) {
                _callbackFunction.call(null, result);
            }
        }

        public function callbackFunction(callbackFunction : Function) : Command {
            _callbackFunction = callbackFunction;
            return this;
        }

        public function args(... args : Array) : Command {
            arguments = args;
            return this;
        }
        
    }

}